_onDestroy() {
this._destroyThumbnails();
this._unqueueUpdateStates();
+ this._clearDropPlaceholderLater();
if (this._settings)
this._settings.run_dispose();
this.queue_relayout();
}
+ _clearDropPlaceholderLater() {
+ if (!this._dropPlaceholderLater)
+ return;
+
+ global.compositor.get_laters().remove(this._dropPlaceholderLater);
+ delete this._dropPlaceholderLater;
+ }
+
_getPlaceholderTarget(index, spacing, rtl) {
const workspace = this._thumbnails[index];
this._dropPlaceholder.allocate_preferred_size(
...this._dropPlaceholder.get_position());
- const laters = global.compositor.get_laters();
- laters.add(Meta.LaterType.BEFORE_REDRAW, () => {
- this._dropPlaceholder.hide();
- });
+ this._clearDropPlaceholderLater();
+ if (this._dropPlaceholder.visible) {
+ const laters = global.compositor.get_laters();
+ this._dropPlaceholderLater = laters.add(
+ Meta.LaterType.BEFORE_REDRAW, () => {
+ this._dropPlaceholder.hide();
+ delete this._dropPlaceholderLater;
+ });
+ }
}
const childBox = new Clutter.ActorBox();
this._dropPlaceholder.allocate(childBox);
- const laters = global.compositor.get_laters();
- laters.add(Meta.LaterType.BEFORE_REDRAW, () => {
- this._dropPlaceholder.show();
- });
+ this._clearDropPlaceholderLater();
+ if (!this._dropPlaceholder.visible) {
+ const laters = global.compositor.get_laters();
+ this._dropPlaceholderLater = laters.add(
+ Meta.LaterType.BEFORE_REDRAW, () => {
+ this._dropPlaceholder.show();
+ delete this._dropPlaceholderLater;
+ });
+ }
x += placeholderWidth + spacing;
}